/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - core/memory
// Copyright( c) 2013.  All Rights Reserved
//
// File:		AESystemSceneI.h
// Author:		Gianluca Belardelli
// Date:		09/04/2014
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AESYSTEMSCENEI_H_
#define _AESYSTEMSCENEI_H_

class AESystemSceneI : public AESubjectI, public AEObserverI
{
	friend class AEEngineSystem;

// Members
protected:
    AEBOOL32		m_bInitialized;
    AEEngineSystem	*m_lpSystem;

public:
    /// <summary>
    ///   Enumeration for informing the ISystemScene on what is occuring.
    ///   <para>Pre and post loading are used to inform when the framework being and ends
    ///          completely loading a scene.</para>
    ///   <para>Pre and post destroying are used to inform when the framework being and ends
    ///          completely destroying a scene.</para>
    /// </summary>
    enum AEGlobalSceneStatus
    {
        AEGSS_PreLoadingObjects,
		AEGSS_PostLoadingObjects,
		AEGSS_PreDestroyingObjects,
		AEGSS_PostDestroyingObjects
    };

// Methods
public:
    /// <summary>
    ///   Constructor.
    /// </summary>
    /// <param name="pSystem">The system this scene belongs to.</param>
    AESystemSceneI( AEEngineSystem *lpSystem );

    /// <summary>
    ///   Gets the system this object belongs to.
    /// </summary>
    /// <returns>A pointer to the system.</returns>
    AEEngineSystem *GetSystem( void )
    {
        return m_lpSystem;
    }

    /// <summary>
    ///   Gets the system type for this system scene.
    /// </summary>
    /// <remarks>
    ///   This is a shortcut to getting the system type w/o having to go the system first.
    /// </remarks>
    /// <returns>The type of the system.</returns>
    virtual AEUINT32 GetSystemType( void ) = 0;



    /// <summary>
    ///   Called from the framework to inform the scene extension of the overall scene status.
    /// </summary>
    /// <param name="Status">The overall scene status.</param>
    virtual void GlobalSceneStatusChanged( AEGlobalSceneStatus gssStatus ) {}

    /// <summary>
    ///   One time initialization function for the scene.
    /// </summary>
    /// <param name="Properties">Property structure array to fill in.</param>
    /// <returns>An error code.</returns>
    //virtual AEUINT32 Initialize( std::vector<Properties::Property> Properties ) = 0;

    /// <summary>
    ///   Gets the properties of this scene.
    /// </summary>
    /// <param name="Properties">Property structure array to fill.</param>
    //virtual void GetProperties( std::vector<Properties::Property>& Properties ) = 0;

    /// <summary>
    ///   Sets the properties for this scene.
    /// </summary>
    /// <param name="Properties">Property structure array to get values from.</param>
    //virtual void SetProperties( std::vector<Properties::Property> Properties ) = 0;

    /// <summary>
    ///   Get all the available object types as names.
    /// </summary>
    /// <returns>A NULL terminated array of object type names.</returns>
    virtual char *GetObjectTypes( void ) = 0;

    /// <summary>
    ///   Creates a system object used to extend a UObject.
    /// </summary>
    /// <param name="pszName">The unique name for this object.</param>
    /// <param name="pszType">The object type to create.</param>
    /// <returns>The newly created system object.</returns>
    virtual AESystemObjectI *CreateObject( char *lpName, char *lpType ) = 0;

    /// <summary>
    ///   Destroys a system object.
    /// </summary>
    /// <param name="pSystemObject">The system object to destroy.</param>
    /// <returns>An error code.</returns>
    virtual AEUINT32 DestroyObject( AESystemObjectI *lpSystemObject ) = 0;

    /// <summary>
    ///   Returns a pointer to the task that this scene needs to perform on its objects.
    /// </summary>
    /// <returns>The task for this scene.</returns>
    virtual AESystemTaskI *GetSystemTask( void ) = 0;

    /// <summary>
    ///   Returns a bit mask of System Changes that this scene wants to receive changes for.  Used
    ///    to inform the change control manager if this scene should be informed of the
    ///    change.
    /// </summary>
    /// <returns>A System::Changes::BitMask.</returns>
    virtual AEUINT32 GetDesiredSystemChangesMask( void ) { return 0; };

    /// <summary cref="IObserver::ChangeOccurred">
    ///   Implementation of the IObserver ChangeOccurred function.
    /// </summary>
    virtual AEUINT32 ChangeOccurred( AESubjectI *lpSubject, AEUINT32 uiChangeMask )
    {
        return 0;
    }
};

#endif // _AESYSTEMSCENEI_H_
